<?php
require ("../include/config.php");

require($config['basedir']."/admin/classes/login.class.php");
$obj_login = new Login();
$obj_login->redirectLoginUser();
$post = $_REQUEST;

$_action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';

switch($_action) {


	case 'reset_password':
		
		if(isset($post['submit']))
		{
			$obj_login->resetPassword($post);
		}
		
		if($post['updated'] == 1)
		{
			stemplate::assign("password_reset", 1);	
		}
		

	
	stemplate::display("admin/reset_password.tpl");	
		
	break;

	case 'view':
	default:
	
		if( $obj_login->isValidCode($post['reset_code']) ) {
			stemplate::assign("valid_code", 1);		
		} else {
			stemplate::assign("valid_code", 2);		
		}
		
		stemplate::assign("post", $post);	
		stemplate::display("admin/reset_password.tpl");
	
	
	break;


}




?>


